package com.zq.create.builder;

public class ConcreteProductA extends Product {
    private int type;

    public static class Builder extends Product.Builder<Builder> {
        private int type;

        Builder setType(int type) {
            this.type = type;
            return this;
        }

        @Override
        protected Builder self() {
            return this;
        }

        @Override
        public ConcreteProductA build() {
            return new ConcreteProductA(this);
        }
    }

    private ConcreteProductA(Builder builder) {
        super(builder);
        this.type = builder.type;
    }

    public int getType() {
        return type;
    }

    @Override
    public String toString() {
        return "ConcreteProductA{" +
                "name=" + getName() + ", " +
                "id=" + getId() + ", " +
                "type=" + getType() +
                '}';
    }
}
